using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Diagnostics;
using System.Drawing.Drawing2D;
namespace BPMN.MainWindow
{
    public abstract class EventEnd : Event
    {
        public override void updateHotSpots()
        {
            base.updateHotSpots();
        }
        public EventEnd(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEnd()
            : base()
        {

        }
        public EventEnd(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
         //   graphics.FillEllipse(Variables.DrawingBrush, BoundingBox.Location.X + offset.X, BoundingBox.Location.Y + offset.Y, Size.Width, Size.Height);
         //   graphics.FillEllipse(brush, BoundingBox.Location.X + offset.X + Size.Width / 7, BoundingBox.Location.Y + offset.Y + Size.Height / 7, 3*Size.Width/4-1,3*Size.Height/4-1);
            graphics.FillEllipse(Variables.DrawingBrush, BoundingBox.Location.X + offset.X, BoundingBox.Location.Y + offset.Y, Size.Width, Size.Height);
            graphics.FillEllipse(brush, BoundingBox.Location.X + offset.X + Size.Width / 8, BoundingBox.Location.Y + offset.Y + Size.Height / 8, 6 * Size.Width / 8, 6 * Size.Height / 8);

        }
    }
    public class EventEndNone : EventEnd
    {
        public EventEndNone(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndNone()
            : base()
        {

        }
        [Constructor]
        public EventEndNone(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);

        }
    }
    public class EventEndMessage : EventEnd
    {
        public EventEndMessage(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndMessage()
            : base()
        {

        }
        [Constructor]
        public EventEndMessage(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
            graphics.DrawRectangle(pen, BoundingBox.Location.X + offset.X + 8, BoundingBox.Location.Y + offset.Y + 8, Size.Width - 16, Size.Height - 16);
            graphics.DrawLine(pen, BoundingBox.Location.X + offset.X + 8, BoundingBox.Location.Y + offset.Y + 8, BoundingBox.Location.X + offset.X + Size.Width / 2, BoundingBox.Location.Y + offset.Y + Size.Height / 2);
            graphics.DrawLine(pen, BoundingBox.Location.X + offset.X + Size.Width / 2, BoundingBox.Location.Y + offset.Y + Size.Height / 2, BoundingBox.Location.X + offset.X - 8 + Size.Width, BoundingBox.Location.Y + offset.Y + 8);

        }
    }
    public class EventEndError : EventEnd
    {
        public EventEndError(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndError()
            : base()
        {

        }
        [Constructor]
        public EventEndError(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
            GraphicsPath gp = new GraphicsPath();
            PointF[] points = new PointF[4];
            points[0] = new PointF(Location.X + offset.X - Size.Width / 8, Location.Y + offset.Y - Size.Height / 10);
            points[1] = new PointF(Location.X + offset.X - Size.Width / 10, Location.Y + offset.Y + Size.Height / 10);
            points[2] = new PointF(Location.X + offset.X + Size.Width / 10, Location.Y + offset.Y - Size.Height / 10);
            points[3] = new PointF(Location.X + offset.X + Size.Width / 8, Location.Y + offset.Y + Size.Height / 10);
            gp.AddLines(points);
            Pen p = new Pen(Variables.DrawingBrush, Size.Width / 14);
            graphics.DrawPath(p, gp);

        }
    }
    public class EventEndCancel : EventEnd
    {
        
        public EventEndCancel(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndCancel()
            : base()
        {

        }
        [Constructor]
        public EventEndCancel(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {
           
        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
            Pen p = new Pen(Variables.DrawingBrush, Size.Width / 8);
            graphics.DrawLine(p, Location.X + offset.X - Size.Width / 5, Location.Y + offset.Y - Size.Height / 5, Location.X + offset.X + Size.Width / 5, Location.Y + offset.Y + Size.Height / 5);
            graphics.DrawLine(p, Location.X + offset.X - Size.Width / 5, Location.Y + offset.Y + Size.Height / 5, Location.X + offset.X + Size.Width / 5, Location.Y + offset.Y - Size.Height / 5);


        }
    }
    public class EventEndCompensation : EventEnd
    {
        public EventEndCompensation(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndCompensation()
            : base()
        {

        }
        [Constructor]
        public EventEndCompensation(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
            GraphicsPath gp = new GraphicsPath();
            PointF[] points = new PointF[4];
            points[0] = new PointF(Location.X + offset.X, Location.Y + offset.Y);
            points[2] = new PointF(Location.X + offset.X + Size.Width / 4, Location.Y + offset.Y - Size.Height / 4);
            points[3] = new PointF(Location.X + offset.X, Location.Y + offset.Y);
            points[1] = new PointF(Location.X + offset.X + Size.Width / 4, Location.Y + offset.Y + Size.Height / 4);
            gp.AddLines(points);
            PointF[] points2 = new PointF[4];
            points2[0] = new PointF(Location.X + offset.X - Size.Width / 3, Location.Y + offset.Y);
            points2[2] = new PointF(Location.X + offset.X, Location.Y + offset.Y - Size.Height / 4);
            points2[3] = new PointF(Location.X + offset.X - Size.Width / 3, Location.Y + offset.Y);
            points2[1] = new PointF(Location.X + offset.X, Location.Y + offset.Y + Size.Height / 4);
            gp.AddLines(points2);
            graphics.FillPath(Variables.DrawingBrush, gp);

        }
    }
    public class EventEndLink : EventEnd
    {
        public EventEndLink(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndLink()
            : base()
        {

        }
        [Constructor]
        public EventEndLink(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
            GraphicsPath gp = new GraphicsPath();
            PointF[] points = new PointF[4];
            points[0] = new PointF(Location.X + offset.X + Size.Width / 3, Location.Y + offset.Y);
            points[1] = new PointF(Location.X + offset.X + Size.Width / 10, Location.Y + offset.Y + Size.Height / 3);
            points[2] = new PointF(Location.X + offset.X + Size.Width / 10, Location.Y + offset.Y - Size.Height / 3);
            points[3] = new PointF(Location.X + offset.X + Size.Width / 3, Location.Y + offset.Y);
            gp.AddLines(points);
            graphics.FillPath(Variables.DrawingBrush, gp);
            graphics.FillRectangle(Variables.DrawingBrush, Location.X + offset.X - Size.Width / 3, Location.Y + offset.Y - Size.Height / 8, 2 * Size.Width / 5, Size.Height / 4);


        }
    }
    public class EventEndMultiple : EventEnd
    {
        public EventEndMultiple(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndMultiple()
            : base()
        {

        }
        [Constructor]
        public EventEndMultiple(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
            GraphicsPath gp = new GraphicsPath();
            PointF[] points = new PointF[4];
            points[0] = new PointF(Location.X + offset.X, Location.Y + offset.Y - Size.Height / (float)2.8);
            points[1] = new PointF(Location.X + offset.X + Size.Width / 3, Location.Y + offset.Y + Size.Height / 6);
            points[2] = new PointF(Location.X + offset.X - Size.Width / 3, Location.Y + offset.Y + Size.Height / 6);
            points[3] = new PointF(Location.X + offset.X, Location.Y + offset.Y - Size.Height / (float)2.8);
            gp.AddLines(points);
            graphics.FillPath(Variables.DrawingBrush, gp);
            GraphicsPath gp2 = new GraphicsPath();
            PointF[] points2 = new PointF[4];
            points2[0] = new PointF(Location.X + offset.X, Location.Y + offset.Y + Size.Height / (float)2.8);
            points2[1] = new PointF(Location.X + offset.X + Size.Width / 3, Location.Y + offset.Y - Size.Height / 6);
            points2[2] = new PointF(Location.X + offset.X - Size.Width / 3, Location.Y + offset.Y - Size.Height / 6);
            points2[3] = new PointF(Location.X + offset.X, Location.Y + offset.Y + Size.Height / (float)2.8);
            gp2.AddLines(points2);
            graphics.FillPath(Variables.DrawingBrush, gp2);
        }
    }
    public class EventEndTerminate : EventEnd
    {
        public EventEndTerminate(PointF location, SizeF size)
            : base(location, size)
        {

        }

        public EventEndTerminate()
            : base()
        {

        }
        [Constructor]
        public EventEndTerminate(PointF location, SizeF size, FigureState state)
            : base(location, size, state)
        {

        }

        public override void Draw(Graphics graphics, Pen pen, Brush brush, PointF offset)
        {

            base.Draw(graphics, pen, brush, offset);
            graphics.FillEllipse(Variables.DrawingBrush, BoundingBox.Location.X + offset.X + Size.Width / 4, BoundingBox.Location.Y + offset.Y + Size.Width / 4, Size.Width/2 , Size.Height/2);


        }
    }
}
